import org.springframework.beans.factory.BeanFactoryAware
import org.springframework.beans.factory.BeanFactory
import org.springframework.beans.BeansException

class IndexController implements BeanFactoryAware{
    
    def indexTaskExecutor
    def beanFactory
    
    void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        this.beanFactory = beanFactory
    }
    
    def entry = {
        def process = beanFactory.getBean('indexProcess')
        process.entry = Entry.get(params.id)
        indexTaskExecutor.execute(process)
        
        render(text:'ok')
    }

}